1. Field of Invention
The present invention relates to computer programs, and more particularly to a computer system, including programming principles and practices, used in converting statements from one computer language into a different, generally inconsistent language. The invention in its preferred embodiment further relates to, inter alia, an interfacing program which allows a COBOL program, despite its totally different nature and internal data handling constructs and statement approaches, to generate Structured Query Language (SQL) statements in creating, accessing and/or using data from a SQL oriented database and getting appropriate data back in a form consistent with what the COBOL program expects.
2. General Background
As noted in the SQL Programmer's Guide (Gupta & Gietz, Que, 1989, ISBN 0-88022:390-1), a database is like an electronic "filing cabinet". It is used for the same purpose as any other filing cabinet--to store records. A basic difference, of course, is that, with a database, the records are stored electronically.
To get at stored records, or even to store them in the first place, a system is needed for managing the database. A database management system (DBMS) enables operations to be performed, e.g.--"Bring me this file," "Update this record," etc.--on the contents of the cabinet.
Various types of DBMS's exist, representing different approaches to the tasks of furnishing access to information in a database, preserving the data's integrity, keeping track of the users, providing security, and so on. Generally speaking, ali of the DBMS's can be classified into two kinds--relational and non-relational. By and large, all of the newer systems on the market are "relational".
One of the relational type database languages that has been gaining great prominence is the Structured Query Language (SQL), formerly called "Sequel". SQL's background and history, and the details and workings of the language, are described in, for example, the SQL Programmer's Guide referred to above. Although the language has not been totally standardized and there are a number of vendors (e.g., Informix.TM., Oracle.TM., etc.) who sell variants of the language, SQL generally will include at least the following statements (or their equivalents or variants) which are used in the exemplary embodiment of the present invention:
______________________________________ ALTER ALTER TABLE CLOSE COMMIT CREATE INDEX CREATE TABLE DECLARE CURSOR DELETE DROP EXEC SQL EXECUTE FETCH FETCH INTO GRANT GROUP BY INSERT MODIFY OPEN ORDER BY PREPARE RENAME TABLE ROLLBACK SELECT UPDATE WHENEVER ______________________________________
With respect to the nature or structure of an SQL oriented database, it includes a collection of tables (each two dimensional having columns and rows), in which the data has been at least in part pre-processed. It includes a series of restrictions and qualifications not found in other languages, particularly COBOL (Common Business Oriented Language), which as explained more fully below, has its own philosophical approaches, restrictions and qualifications.
Many companies today have developed very valuable SQL oriented databases having values in the many millions of dollars, and it is highly desirable for a company's program(s) to be able to access and manipulate the data in such databases through the SQL language. However, a number of well established business programs which are very widely in use today (perhaps even dominant in the business world), being based on programming languages which were created many years ago, were written in languages having a totally different approach and programming philosophy highly inconsistent with the approach and philosophy of SQL, making the two very large and very valuable "worlds" heretofore practically inconsistent and incompatible.
A prime example of this situation is the business dominant programming language of COBOL, which traces its development back to 1960 (and earlier). It has had at least two standardized versions since then, namely ANSI-74 and ANSI-85.
For additional background information on the COBOL language and in particular the AcuCOBOL.TM.-85 version of the COBOL (ANSI-85) language, in which the exemplary embodiment of the invention described in detail below was developed, reference is had to, for example, the AcuCOBOL.TM.-85 COBOL COMPILER (Version 2.0) User's Guide & Reference Manual (AcuCOBOL, Inc., San Diego, Calif., 1991), the disclosures of which are incorporated herein by reference.
COBOL's database scheme is purely sequential and non-relational due to its historical development many years ago during the time period when the only practically available form of "memory" was IBM.TM. type punch cards, paper tape and later magnetic tape. Such a scheme is purely one dimensional and is very limited in comparison to the approaches of DBMS's available today, such as, for example, the Structured Query Language or "SQL" database, discussed above.
In contrast, a SQL database is a relational database which is random in nature in the way it presents its data in its two dimensional tables in its database structure. The randomness nature of an SQL database is part of its strength. However, when one remembers the dominant existence of COBOL programs through out the world, it and the totally different way the two languages handle and consider data and the significant differences in allowed language statements, has created a heretofore insurmountable obstacle insofar as allowing a COBOL program to use an SQL oriented database.
However, those obstacles have all been overcome in the present invention, with the invention achieving for the first time that which was heretofore thought to be at least practically if not technically impossible.